package app.util;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class DateUtils {

	public static String getDataAtual() {
		StringBuilder dataAtual = new StringBuilder();
		Calendar calendar = new GregorianCalendar();

		dataAtual.append(calendar.get(Calendar.YEAR));
		dataAtual.append("-");
		dataAtual.append(calendar.get(Calendar.MONTH) + 1);
		dataAtual.append("-");
		dataAtual.append(calendar.get(Calendar.DATE));
		
		return dataAtual.toString();
	}
	
	public static String getHoraAtual() {
		StringBuilder horaAtual = new StringBuilder();
		Calendar calendar = new GregorianCalendar();
		
		horaAtual.append(calendar.get(Calendar.HOUR_OF_DAY));
		horaAtual.append(":");
		horaAtual.append(calendar.get(Calendar.MINUTE));
		horaAtual.append(":");
		horaAtual.append(calendar.get(Calendar.SECOND));
		
		return horaAtual.toString();
	}
	
}
